home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr27 / gs26.zip / GS_DPS1.PS < prev    next >
Text File  |  1993-04-16  |  10KB  |  300 lines

  1. %    Copyright (C) 1990, 1991 Aladdin Enterprises.  All rights reserved.
  2. %    Distributed by Free Software Foundation, Inc.
  3. %
  4. % This file is part of Ghostscript.
  5. %
  6. % Ghostscript is distributed in the hope that it will be useful, but
  7. % WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. % to anyone for the consequences of using it or for whether it serves any
  9. % particular purpose or works at all, unless he says so in writing.  Refer
  10. % to the Ghostscript General Public License for full details.
  11. %
  12. % Everyone is granted permission to copy, modify and redistribute
  13. % Ghostscript, but only under the conditions described in the Ghostscript
  14. % General Public License.  A copy of this license is supposed to have been
  15. % given to you along with Ghostscript so you can know your rights and
  16. % responsibilities.  It should be in a file named COPYING.  Among other
  17. % things, the copyright notice and this notice must be preserved on all
  18. % copies.
  19.  
  20. % Initialization file for analogs of Display PostScript functions
  21. % that are also included in Level 2.
  22. % When this is run, systemdict is still writable,
  23. % but everything defined here goes into level2dict.
  24.  
  25. level2dict begin
  26.  
  27. % ------ Binary token support ------ %
  28.  
  29. % Initialization for the system name table.
  30.  
  31. mark
  32. % 0
  33.     /abs /add /aload /anchorsearch /and
  34.     /arc /arcn /arct /arcto /array
  35.     /ashow /astore /awidthshow /begin /bind
  36.     /bitshift /ceiling /charpath /clear /cleartomark
  37. % 20
  38.     /clip /clippath /closepath /concat /concatmatrix
  39.     /copy /count /counttomark /currentcmykcolor /currentdash
  40.     /currentdict /currentfile /currentfont /currentgray /currentgstate
  41.     /currenthsbcolor /currentlinecap /currentlinejoin /currentlinewidth /currentmatrix
  42. % 40
  43.     /currentpoint /currentrgbcolor /currentshared /curveto /cvi
  44.     /cvlit /cvn /cvr /cvrs /cvs
  45.     /cvx /def /defineusername /dict /div
  46.     /dtransform /dup /end /eoclip /eofill
  47. % 60
  48.     /eoviewclip /eq /exch /exec /exit
  49.     /file /fill /findfont /flattenpath /floor
  50.     /flush /flushfile /for /forall /eg
  51.     /get /getinterval /grestore /gsave /gstate
  52. % 80
  53.     /gt /identmatrix /idiv /idtransform /if
  54.     /ifelse /image /imagemask /index /ineofill
  55.     /infill /initviewclip /inueofill /inufill /invertmatrix
  56.     /itransform /known /le /length /lineto
  57. % 100
  58.     /load /loop /lt /makefont /matrix
  59.     /maxlength /mod /moveto /mul /ne
  60.     /neg /newpath /not /null /or
  61.     /pathbbox /pathfoall /pop /print /printobject
  62. % 120
  63.     /put /putinterval /rcurveto /read /readhexstring
  64.     /readline /readstring /rectclip /rectfill /rectstroke
  65.     /rectviewclip /repeat /restore /rlineto /rmoveto
  66.     /roll /rotate /round /save /scale
  67. % 140
  68.     /scalefont /search /selectfont /setbbox /setcachedevice
  69.     /setcachedevice2 /setcharwidth /setcmykcolor /setdash /setfont
  70.     /setgray /setgstate /sethsbcolor /setlinecap /setlinejoin
  71.     /setlinewidth /setmatrix /setrgbcolor /setshared /shareddict
  72. % 160
  73.     /show /showpage /stop /stopped /store
  74.     /string /stringwidth /stroke /strokepath /sub
  75.     /systemdict /token /transform /translate /truncate
  76.     /type /uappend /ucache /ueofill /ufill
  77. % 180
  78.     /undef /upath /userdict /ustroke /viewclip
  79.     /viewclippath /where /widthshow /write /writehexstring
  80.     /writeobject /writestring /wtranslation /xor /xshow
  81.     /xyshow /yshow /FontDirectory /SharedFontDirectory /Courier
  82. % 200
  83.     /Courier-Bold /Courier-BoldOblique /Courier-Oblique /Helvetica /Helvetica-Bold
  84.     /Helvetica-BoldOblique /Helvetica-Oblique /Symbol /Times-Bold /Times-BoldItalic
  85.     /Times-Italic /Times-Roman /execuserobject /currentcolor /currentcolorspace
  86.     /currentglobal /execform /filter /findresource /globaldict
  87. % 220
  88.     /makepattern /setcolor /setcolorspace /setglobal /setpagedevice
  89.     /setpattern
  90. % pad to 256
  91.     counttomark 256 exch sub { 0 } repeat
  92. % 256
  93.     /= /== /ISOLatin1Encoding /StandardEncoding
  94. % 260
  95.     /[ /] /atan /banddevice /bytesavailable
  96.     /cachestatus /closefile /colorimage /condition /copypage
  97.     /cos /countdictstack /countexecstack /cshow /currentblackgeneration
  98.     /currentcacheparams /currentcolorscreen /currentcolortransfer /currentcontext /currentflat
  99. % 280
  100.     /currenthalftone /currenthalftonephase /currentmiterlimit /currentobjectformat /currentpacking
  101.     /currentscreen /currentstrokeadjust /currenttransfer /currentundercolorremoval /defaultmatrix
  102.     /definefont /deletefile /detach /deviceinfo /dictstack
  103.     /echo /erasepage /errordict /execstack /executeonly
  104. % 300
  105.     /exp /false /filenameforall /fileposition /fork
  106.     /framedevice /grestoreall /handleerror /initclip /initgraphics
  107.     /initmatrix /instroke /inustroke /join /kshow
  108.     /ln /lock /log /mark /monitor
  109. % 320
  110.     /noaccess /notify /nulldevice /packedarray /quit
  111.     /rand /rcheck /readonly /realtime /renamefile
  112.     /renderbands /resetfile /reversepath /rootfont /rrand
  113.     /run /scheck /setblackgeneration /setcachelimit /setcacheparams
  114. % 340
  115.     /setcolorscreen /setcolortransfer /setfileposition /setflat /sethalftone
  116.     /sethalftonephase /setmiterlimit /setobjectformat /setpacking /setscreen
  117.     /setstrokeadjust /settransfer /setucacheparams /setundercolorremoval /sin
  118.     /sqrt /srand /stack /status /statusdict
  119. % 360
  120.     /true /ucachestatus /undefinefont /usertime /ustrokepath
  121.     /version /vmreclaim /vmstatus /wait /wcheck
  122.     /xcheck /yield /defineuserobject /undefineuserobject /UserObjects
  123.     /cleardictstack
  124. % 376
  125.     /A /B /C /D /E /F /G /H /I /J /K /L /M
  126.     /N /O /P /Q /R /S /T /U /V /W /X /Y /Z
  127.     /a /b /c /d /e /f /g /h /i /j /k /l /m
  128.     /n /o /p /q /r /s /t /u /v /w /x /y /z
  129. % 428
  130.     /setvmthreshold (<<) cvn
  131.     (>>) cvn /currentcolorrendering /currentdevparams /currentoverprint /currentpagedevice
  132.     /currentsystemparams /currentuserparams /defineresource /findencoding /gcheck
  133. % 440
  134.     /glyphshow /languagelevel /product /pstack /resourceforall
  135.     /resourcestatus /revision /serialnumber /setcolorrendering /setdevparams
  136.     /setoverprint /setsystemparams /setuserparams /startjob /undefineresource
  137.     /GlobalFontDirectory /ASCII85Decode /ASCII85Encode /ASCIIHexDecode /ASCIIHexEncode
  138. % 460
  139.     /CCITTFaxDecode /CCITTFaxEncode /DCTDecode /DCTEncode /LZWDecode
  140.     /LZWEncode /NullEncode /RunLengthDecode /RunLengthEncode /SubFileDecode
  141.     /CIEBasedA /CIEBasedABC /DeviceCMYK /DeviceGray /DeviceRGB
  142.     /Indexed /Pattern /Separation
  143. % 478 -- end
  144. counttomark packedarray exch pop
  145.  
  146. % Install the system and user name tables.
  147. % The user name table is read-only for ordinary programs,
  148. % since it doesn't obey save/restore and must be managed specially.
  149.  
  150. dup /SystemNames exch def
  151. 100 array readonly dup /UserNames exch def
  152. .installnames
  153.  
  154. % Define printobject and writeobject.
  155.  
  156. /printobject { .stdout 3 1 roll writeobject } odef
  157.  
  158. /.writeobjectbuf 1 array def
  159. /writeobject { exch .writeobjectbuf dup 0 4 -1 roll put .writeobjects } odef
  160.  
  161. % Implement binary error message output.
  162. errordict begin
  163.   /.printerror
  164.    { $error /binary get .languagelevel 2 eq and
  165.       { currentobjectformat 0 ne
  166.          { [ /Error $error /errorname get $error /command get false
  167.        ] 250 printobject
  168.      }
  169.      //.printerror
  170.     ifelse
  171.       }
  172.       //.printerror
  173.      ifelse
  174.    } bind def
  175. end
  176.  
  177. % ------ Fonts ------ %
  178.  
  179. /selectfont
  180.     { exch findfont exch
  181.       dup type /arraytype eq { makefont } { scalefont } ifelse
  182.       setfont
  183.     } odef
  184. /undefinefont
  185.     { FontDirectory exch undef
  186.     } odef
  187.  
  188. % ------ Halftones ------ %
  189.  
  190. /.currenthalftonetypes [
  191.     { exch pop } bind        % halftone
  192.     { /HalftoneType 1        % screen
  193.        { /Frequency /Angle /SpotFunction }
  194.       .makestackdict
  195.     }
  196.     { /HalftoneType 2        % colorscreen
  197.        { /RedFrequency /RedAngle /RedSpotFunction
  198.          /GreenFrequency /GreenAngle /GreenSpotFunction
  199.          /BlueFrequency /BlueAngle /BlueSpotFunction
  200.          /GrayFrequency /GrayAngle /GraySpotFunction
  201.        }
  202.       .makestackdict
  203.     }
  204. ] def
  205. /.makestackdict
  206.     { { counttomark -1 roll } forall dicttomark
  207.     } bind def
  208. /currenthalftone
  209.     { mark .currenthalftone .currenthalftonetypes exch get exec
  210.     } odef
  211. /sethalftone
  212.     { dup /HalftoneType get 1 sub
  213.        { .sethalftone1 .sethalftone2 .sethalftone3 .sethalftone4
  214.          .sethalftone5
  215.        } exch get exec
  216.     } odef
  217. % Redefine setscreen to recognize halftone dictionaries.
  218. /..setscreen /setscreen load def
  219. /setscreen
  220.     { dup type /dicttype eq
  221.        { sethalftone pop pop }
  222.        { ..setscreen }
  223.       ifelse
  224.     } bind odef
  225. % Redefine currentscreen and currentcolorscreen similarly.
  226. /.currentscreentypes [
  227.     { 60 exch 0 exch } bind            % halftone
  228.     { }                    % screen
  229.     { 12 3 roll 9 { pop } repeat }        % colorscreen
  230. ] def
  231. /currentscreen
  232.     { .currenthalftone .currentscreentypes exch get exec
  233.     } odef
  234. /.currentcolorscreentypes [
  235.     { 60 exch 0 exch 3 copy 6 copy } bind    % halftone
  236.     { 3 copy 6 copy } bind            % screen
  237.     { }                    % colorscreen
  238. ] def
  239. /currentcolorscreen
  240.     { .currenthalftone .currentcolorscreentypes exch get exec
  241.     } odef
  242.  
  243. % ------ User objects ------ %
  244.  
  245. % **************** We have to disable .localarray
  246. % **************** because local/global VM isn't really implemented yet.
  247. /.localarray
  248.     { currentshared false setshared
  249.       exch array exch setshared
  250.     } bind def
  251. /.localarray /array load def    % ****************
  252. /defineuserobject
  253.     { userdict /UserObjects known
  254.        { 1 index userdict /UserObjects get length ge
  255.           { 1 index 1 add .localarray userdict /UserObjects get
  256.             1 index copy pop
  257.             userdict /UserObjects 3 -1 roll put
  258.           }
  259.          if
  260.        }
  261.        { userdict /UserObjects 3 index 1 add .localarray put
  262.        }
  263.       ifelse
  264.       userdict /UserObjects get 3 1 roll put
  265.     } odef
  266. /execuserobject
  267.     { userdict /UserObjects get exch get exec
  268.     } odef
  269. /undefineuserobject
  270.     { userdict /UserObjects get exch null put
  271.     } odef
  272.  
  273. % ------ User paths ------ %
  274.  
  275. /upath
  276.     { [ exch {/ucache cvx} if pathbbox /setbbox cvx
  277.       {/moveto cvx} {/lineto cvx} {/curveto cvx} {/closepath cvx}
  278.       pathforall ] cvx
  279.     } odef
  280.  
  281. % Dummy definitions for cache control operators
  282.  
  283. /ucachestatus
  284.     { mark 0 0 0 0 0 } odef
  285. /setucacheparams
  286.     { cleartomark } odef
  287.  
  288. % ------ Virtual memory ------ %
  289.  
  290. %**************** Everything here is a stub. ****************%
  291.  
  292. /setvmthreshold { pop } odef
  293. /shareddict currentdict /globaldict .knownget not { 20 dict } if def
  294. /SharedFontDirectory FontDirectory def
  295. /vmreclaim { pop } odef
  296.  
  297. % End of level2dict
  298.  
  299. end
  300.